package com.xhwl.centiotdata.service.vehicleschedule;

import com.xhwl.centiotdata.integrator.vehicleschedule.sinoiov.TruckQueryResponseDTO;
import com.xhwl.centiotdata.integrator.vehicleschedule.station.StationDTO;
import com.xhwl.common.dto.cent.iotdata.vehicleschedule.*;
import com.xhwl.common.pojo.ResultJson;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 车辆调度开放接口
 */
@RestController
public interface VehicleScheduleService {

    /**
     * 检查车辆是否允许进入
     */
    @PostMapping("/vehicle-schedule/check-truck-enter")
    ResultJson<VehicleScheduleResponseDTO> onCheckingTruckEnter(@RequestBody VehicleScheduleRequestsDTO dto);

    /**
     * 同步车辆事件
     */
    @PostMapping("/vehicle-schedule/sync-truck-events")
    ResultJson<VehicleScheduleResponseDTO> onSyncingTruckEvents(@RequestBody VehicleScheduleRequestsDTO dto);

    /**
     * 同步称重事件
     */
    @PostMapping("/vehicle-schedule/sync-weigh-result")
    ResultJson<VehicleScheduleResponseDTO> onSyncingWeighResult(@RequestBody VehicleScheduleRequestsDTO dto);

    /**
     * 同步地磁状态变更
     */
    @PostMapping("/vehicle-schedule/sync-space-status")
    ResultJson<VehicleScheduleResponseDTO> onSyncingSpaceStatus(@RequestBody VehicleScheduleRequestsDTO dto);

    /**
     * 获取车辆队列
     */
    @PostMapping("/vehicle-schedule/list-truck-queues")
    ResultJson<List<VehicleScheduleResponseDTO>> listTruckQueue(@RequestBody VehicleScheduleRequestsDTO dto);

    /**
     * iotCount1.获取点位车辆队列
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/position-truck-queues")
    ResultJson<List<VehicleScheduleStatisticsResponseDTO>> onQueryPositionTruckQueues(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * iotCount2.获取点位车辆实时情况
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/position-truck-detail")
    ResultJson<List<VehicleScheduleStatisticsResponseDTO>> onQueryPositionTruckDetail(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * iotCount3.获取点位作业数
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/position-truck-counts")
    ResultJson<List<VehicleScheduleStatisticsResponseDTO>> onQueryPositionTruckCounts(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * iotCount7.获取点位车辆信息
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/position-truck")
    ResultJson<List<VehicleScheduleStatisticsResponseDTO>> onQueryPositionTruck(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * iotCount5.获取当日车辆任务情况
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/order-statistics")
    ResultJson<List<VehicleScheduleStatisticsResponseV2DTO>> onQueryOrderStatistics(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * iotCount9.获取运单环节车辆信息
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/flows-statistics")
    ResultJson<List<VehicleScheduleOrderFlowStateResponseDTO>> onQueryFlowsStatistics(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * iotCount10.按时间查询环节车辆
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/query-order-by-node-type")
    ResultJson<List<VehicleScheduleResponseV2DTO>> onQueryOrderFlowState(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * iotCount12.查询奶车待采样队列
     * @param dto 查询条件
     */
    @PostMapping("/vehicle-schedule/query-wait-test-call-truck-list")
    ResultJson<List<VehicleScheduleWaitTestCallTruckDTO>> onQueryWaitTestCallTruckList(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto) throws Exception;

    /**
     * iotCount13.称重列队查询
     */
    @PostMapping("/vehicle-schedule/get-pound-queue-info")
    ResultJson<List<VehicleSchedulePoundQueueInfoDTO>> onQueryPoundQueueInfo(@RequestPart("dto") VehicleScheduleStatisticsRequestsDTO dto) throws Exception;


    /**
     * wms   垛口信息查询
     */
    @PostMapping("/wms-vehicle/flows-statistics")
    ResultJson<List<StationDTO>> stationQuery(@RequestBody VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * wms   排队车辆查询
     */
    ResultJson<List<TruckQueryResponseDTO>> truckQuery(@RequestBody VehicleScheduleStatisticsRequestsDTO dto);

    /**
     * wms   客户信息查询
     */
    ResultJson<List<String>> customerQuery(@RequestParam Integer projectId, @RequestParam String requestTime, @RequestParam String transportOrderCode);

    /**
     * 停车位与点位id的关系
     */
    @PostMapping("/vehicle-schedule/get-sapce-code-info")
    ResultJson getSpaceCodeInfo(@RequestPart("dto") VehicleScheduleRequestsDTO dto);
}
